import 'package:flutter/material.dart';
import '../common/widgets.dart';

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('通用版首页'),
        actions: <Widget>[
          IconButton(
            icon: const Icon(Icons.settings),
            tooltip: 'Setting',
            onPressed: () => Navigator.of(context).pushNamed('/setting'),
          ),
        ],
      ),
      body: Center(
        child: ListView(
          padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0, bottom: 8.0),
          children: <Widget>[
            buildEntryButton(context, '异常测试', '/error_test'),
            buildEntryButton(context, '页面测速', '/page_load_test'),
            buildEntryButton(context, '流畅度测试', '/fluency_test'),
            buildEntryButton(context, '网络测试', '/network_test'),
            buildEntryButton(context, '桥接测试', '/channel_test'),
            buildEntryButton(context, '页面路由跳转测试', '/navigator_test/first_page'),
          ],
        ),
      ),
    );
  }
}
